Skip to content

Conversation

@ZubaeyrMSFT
Copy link

@ZubaeyrMSFT ZubaeyrMSFT commented Nov 21, 2025

Description

ISSUE: #43513 azure-ai-ml needs typing updates for mypy version 1.18.1

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings November 21, 2025 14:13
Copilot finished reviewing on behalf of ZubaeyrMSFT November 21, 2025 14:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses mypy 1.18.1 type checking issues in the azure-ai-ml SDK by adding Optional type hints to setter parameters in AutoML entity classes. This is the first in a series of PRs fixing 16 out of 73 mypy errors, specifically targeting automl entities where setter parameters can accept None values but were not annotated as Optional.

Key changes:

  • Added Optional type annotations to setter parameters across training settings, featurization settings, and job classes
  • Updated corresponding documentation in automl_image_classification_base.py to reflect the Optional type
  • Added TrainingSettings imports to job files to support more flexible typing

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
training_settings.py Added Optional to setter parameters for allowed_training_algorithms and blocked_training_algorithms in Classification, Forecasting, and Regression training settings classes
regression_job.py Updated training setter type hint to accept Union[Dict, TrainingSettings] and added TrainingSettings import
forecasting_job.py Updated training setter type hint to accept Union[Dict, TrainingSettings] and added TrainingSettings import
classification_job.py Updated training setter type hint to accept Union[Dict, TrainingSettings] (import already present)
featurization_settings.py Added Optional to transformer_params and blocked_transformers setter parameters
automl_nlp_job.py Added Optional to training_parameters setter parameter
automl_image_object_detection_base.py Added Optional to training_parameters setter parameter
automl_image_classification_base.py Added Optional to training_parameters setter parameter and updated corresponding docstring type annotation

@ZubaeyrMSFT ZubaeyrMSFT changed the title 1 - next-mypy fixes for automl entities in azure-ai-ml sdk (16/73 issues fixed) next-mypy fixes azure-ai-ml sdk Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant